<?xml version="1.0"?>
<files>
<file filename="export_%exportid%.csv">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl">
<xsl:output method="text"/>

<xsl:variable name="sepstart" select="'&#34;'"/> <!-- &#34; field start seperator, including '' -->
<xsl:variable name="sepend" select="'&#34;,'"/> <!-- field end seperator, including '' -->

<xsl:template match="/">
<xsl:text>"Ordernumber","Orderdate","OrderStatus","PurchasedWebsite","PaymentMethod","ShippingMethod","Subtotal","ShippingCost","GrandTotal","TotalTax","TotalPaid","TotalRefunded","ItemName","ItemSKU","ItemISBN","ItemStock","ItemPrice","CostPrice","ItemOrdered","ItemInvoiced","ItemSent","CustomerID","BillingFirstName","BillingLastName","BillingCompany","BillingE-Mail","BillingPhone","BillingAddress1","BillingAddress2","BillingCity","BillingPostcode","BillingState","BillingCountry","ShippingFirstName","ShippingLastName","ShippingCompany","ShippingE-Mail","ShippingPhone","ShippingAddress1","ShippingAddress2","ShippingCity","ShippingPostcode","ShippingState","ShippingCountry"</xsl:text><xsl:text>&#xD;&#xA;</xsl:text>
<xsl:for-each select="orders/order">
<xsl:for-each select="items/item">

<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../increment_id)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="php:functionString('strftime', '%d/%m/%Y', ../../created_at_timestamp)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../status)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../store_name)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../payment/method)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping_method)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../subtotal)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../payment/shipping_amount)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../grand_total)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../tax_amount)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../total_paid)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../total_refunded)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(name)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(sku)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(attributes/isbn)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(attributes/itemstock)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(price)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(cost)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(qty_ordered)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(qty_invoiced)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(qty_shipped)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../customer_id)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/firstname)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/lastname)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/company)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../customer_email)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/telephone)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/street1)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/street2)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/city)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/postcode)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/region)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../billing/country_id)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/firstname)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/lastname)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/company)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../customer_email)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/telephone)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/street1)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/street2)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/city)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/postcode)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/region)"/><xsl:value-of select="$sepend" />
<xsl:value-of select="$sepstart" /><xsl:value-of select="normalize-space(../../shipping/country_id)"/><xsl:value-of select="$sepend" />

<xsl:text>&#xD;&#xA;</xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
</file>
</files>